package com.wuyu.mini.dubbo.rpc;

import com.wuyu.mini.dubbo.cluster.config.Config;
import com.wuyu.mini.dubbo.cluster.loader.MiniExtensionLoader;

/**
 * rpc工厂
 */
public class RpcFactory {

    public static ConsumerServer getConsumerService() {
        String protocol = Config.Rpc.protocol;
        ConsumerServer extension = MiniExtensionLoader.getExtensionLoader(ConsumerServer.class).getExtension(protocol);
        return extension;
    }

    public static ProviderServer getProviderServer() {
        String protocol = Config.Rpc.protocol;
        ProviderServer extension = MiniExtensionLoader.getExtensionLoader(ProviderServer.class).getExtension(protocol);
        return extension;
    }
}
